package org.example.JVM.ByteCode.Type.CONSTANT;

import org.example.JVM.ByteCode.Type.CpInfo;
import org.example.JVM.ByteCode.Type.U1;
import org.example.JVM.ByteCode.Type.U2;

import java.nio.ByteBuffer;

/**
 * @description:
 * @author: farprt
 * @create: 2022-11-13 16:00
 **/
public class CONSTANT_InvokeDynamic_info extends CpInfo {

    //指向class文件结构属性表中引导方法表的某个引导方法
    private U2 bootstrap_method_attr_index;
    //指向C_NameAndType_info常量
    private U2 name_and_type_index;

    public CONSTANT_InvokeDynamic_info(U1 tag) {
        super(tag);
    }

    @Override
    public void read(ByteBuffer codeBuf) throws Exception {
        bootstrap_method_attr_index = new U2(codeBuf.get(), codeBuf.get());
        name_and_type_index = new U2(codeBuf.get(), codeBuf.get());
    }
}